<?php
$sign = array('奇葩','打下','发的','签名','随机','熊猫');
$api = array('santong','chuanglan');
$channel = array('2','2');
for($i=0;$i<=9000000;$i++) {
    $data                 = array(
        'time'     => time(),
        'msg_type' => 'email',
        'data'     => array(
            [
                'to'      => ',843960877@qq.com,843960877@qq.com,843960877@qq.com,843960877@qq.com,843960877@qq.com',
                'var_title'=>[date('Y-m-d H:i:s'),'fasd454544ggggg'],
                'var_content' => [date('Y-m-d H:i:s'),'fasd454544ggggg','99999'],
                'template'=>'2',
            ],
            [
                'to'      => '05245454@qq.com,',
                'var_content' => ['1111111','2222222','33333333'],
                'template'  => '3'
            ],
            [
                'to'      => '05245454@qq.com,05245454@qq.com,05245454@qq.com,05245454@qq.com,05245454@qq.com,05245454@qq.com,05245454@qq.com,05245454@qq.com,05245454@qq.com,05245454@qq.com,',
                'template'  => '4',
                'var_title'=>[66666666],
            ],
            [
            'to'      => '05245454@qq.com,05245454@qq.com,05245454@qq.com,05245454@qq.com,05245454@qq.com,05245454@qq.com,05245454@qq.com,05245454@qq.com,05245454@qq.com,05245454@qq.com,',
            'template'  => '5',
            ]
        ),
    );
    $data['timely']       = (string)mt_rand(0, 1);
    $data['content_type'] = mt_rand(0, 1);
    if (mt_rand(0, 1)) {
        $data['sms_service'] = $api[mt_rand(0, 1)];
    }
    $data['content_type'] = $channel[mt_rand(0, 1)];
    if (mt_rand(0, 1)) {
        $data['sign'] = $sign[array_rand($sign)];
    }

    $data = json_encode($data, JSON_UNESCAPED_UNICODE);
    $ch   = curl_init('http://msg2.cn');
    #$ch   = curl_init('http://119.23.162.11:8081');
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    $time = microtime(true);
    $res = curl_exec($ch);
    if(curl_errno($ch))
    {
        echo curl_error($ch),'  ',microtime(true) ,PHP_EOL;
    }
    else{
        echo $res,'   ',round((microtime(true)-$time)*1000,2).' 毫秒',PHP_EOL ;
    }
}
